package com.qdxwx.models.course;

import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;

public class CourseNode implements Serializable{

    private static final long serialVersionUID = 7426787262179076872L;

    /**视频节点ID*/
    private int nodeId;
    /**视频父节点*/
    private int parentId;
    /**课程ID*/
    private int courseId;
    /**视频名*/
    private String name;
    /**排序*/
    private int sort;
    /**播放次数*/
    private int playCount;
    /**是否是免费 1免费 2收费*/
    private int free;
    /**阿里云视频id**/
    private String videoUrl;
    /**阿里云视频id**/
    private String nodeKey;
    /**教师ID*/
    private int teacherId;
    /**节点类型 0文件目录 1视频*/
    private int nodeType;
    /**章节时长（单位秒）*/
    private int durations;
    /** 视频类型 */
    private String videoType;
    /**节点list*/
    private List<CourseNode> children =new ArrayList<>();
    private String fileType;//节点文件格式
    private String content;//文本内容
    @JsonFormat(shape=JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime liveBeginTime;//直播开始时间
    @JsonFormat(shape=JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime liveEndTime;//直播结束时间

    /**创建时间*/
    @JsonFormat(shape=JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime addTime;

    private String supplier;//直播供应商 gensee展示互动
    //辅助字段
    private String atlas;//图片集url
    private String queryOrder;//查询排序
    private Integer isAvailable;//1 正常　２　下架   3删除

    private int progress;//学习进度，百份比，暂时大于1等于学完（用于个人中心和播放大厅）

    public int getNodeId() {
        return nodeId;
    }

    public void setNodeId(int nodeId) {
        this.nodeId = nodeId;
    }

    public int getCourseId() {
        return courseId;
    }

    public void setCourseId(int courseId) {
        this.courseId = courseId;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getParentId() {
        return parentId;
    }

    public void setParentId(int parentId) {
        this.parentId = parentId;
    }

    public LocalDateTime getAddTime() {
        return addTime;
    }

    public void setAddTime(LocalDateTime addTime) {
        this.addTime = addTime;
    }

    public int getSort() {
        return sort;
    }

    public void setSort(int sort) {
        this.sort = sort;
    }

    public int getPlayCount() {
        return playCount;
    }

    public void setPlayCount(int playCount) {
        this.playCount = playCount;
    }

    public int getFree() {
        return free;
    }

    public void setFree(int free) {
        this.free = free;
    }

    public String getNodeKey() {
        return nodeKey;
    }

    public void setNodeKey(String nodeKey) {
        this.nodeKey = nodeKey;
    }

    public String getVideoUrl() {
        return videoUrl;
    }

    public void setVideoUrl(String videoUrl) {
        this.videoUrl = videoUrl;
    }

    public int getTeacherId() {
        return teacherId;
    }

    public void setTeacherId(int teacherId) {
        this.teacherId = teacherId;
    }

    public int getNodeType() {
        return nodeType;
    }

    public void setNodeType(int nodeType) {
        this.nodeType = nodeType;
    }

    public int getDurations() {
        return durations;
    }

    public void setDurations(int durations) {
        this.durations = durations;
    }

    public String getVideoType() {
        return videoType;
    }

    public void setVideoType(String videoType) {
        this.videoType = videoType;
    }

    public List<CourseNode> getChildren() {
        return children;
    }

    public void setChildren(List<CourseNode> children) {
        this.children = children;
    }

    public String getFileType() {
        return fileType;
    }

    public void setFileType(String fileType) {
        this.fileType = fileType;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }



    public LocalDateTime getLiveBeginTime() {
        return liveBeginTime;
    }

    public void setLiveBeginTime(LocalDateTime liveBeginTime) {
        this.liveBeginTime = liveBeginTime;
    }

    public LocalDateTime getLiveEndTime() {
        return liveEndTime;
    }

    public void setLiveEndTime(LocalDateTime liveEndTime) {
        this.liveEndTime = liveEndTime;
    }

    public String getSupplier() {
        return supplier;
    }

    public void setSupplier(String supplier) {
        this.supplier = supplier;
    }

    public String getAtlas() {
        return atlas;
    }

    public void setAtlas(String atlas) {
        this.atlas = atlas;
    }

    public String getQueryOrder() {
        return queryOrder;
    }

    public void setQueryOrder(String queryOrder) {
        this.queryOrder = queryOrder;
    }

    public Integer getIsAvailable() {
        return isAvailable;
    }

    public void setIsAvailable(Integer isAvailable) {
        this.isAvailable = isAvailable;
    }

    public int getProgress() {
        return progress;
    }

    public void setProgress(int progress) {
        this.progress = progress;
    }

    @Override
    public String toString() {
        return "CourseNode{" +
                "nodeId=" + nodeId +
                ", courseId=" + courseId +
                ", name='" + name + '\'' +
                ", parentId=" + parentId +
                ", addTime=" + addTime +
                ", sort=" + sort +
                ", playCount=" + playCount +
                ", free=" + free +
                ", nodeKey='" + nodeKey + '\'' +
                ", teacherId=" + teacherId +
                ", nodeType=" + nodeType +
                ", durations=" + durations +
                ", videoType='" + videoType + '\'' +
                ", fileType='" + fileType + '\'' +
                ", content='" + content + '\'' +
                ", liveBeginTime=" + liveBeginTime +
                ", liveEndTime=" + liveEndTime +
                ", supplier='" + supplier + '\'' +
                ", atlas='" + atlas + '\'' +
                ", queryOrder='" + queryOrder + '\'' +
                ", isAvailable=" + isAvailable +
                ", progress='" + progress + '\'' +
                '}';
    }
}
